// InsertDlg.cpp : implementation file
//

#include "stdafx.h"
#include "GetFileVerInfo.h"
#include "InsertDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CInsertDlg dialog


CInsertDlg::CInsertDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CInsertDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CInsertDlg)
	m_strFileName = _T("");
	m_strFileVersion = _T("");
	//}}AFX_DATA_INIT
}


void CInsertDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CInsertDlg)
	DDX_Text(pDX, IDC_EDIT_FILENAME, m_strFileName);
	DDX_Text(pDX, IDC_EDIT_FILEVER, m_strFileVersion);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CInsertDlg, CDialog)
	//{{AFX_MSG_MAP(CInsertDlg)
	ON_BN_CLICKED(IDC_BTN_PATHNAME, OnBtnPathname)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CInsertDlg message handlers

void CInsertDlg::OnBtnPathname() 
{
	// TODO: Add your control notification handler code here
	CFileDialog *pdlg = NULL;
	pdlg = new CFileDialog(TRUE, NULL, NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "DLL Files (*.dll)|*.dll|EXE Files (*.exe)|*.exe|All Files (*.*)|*.*||", NULL);
	if (NULL != pdlg)
	{
		if (IDOK == pdlg->DoModal())
		{
			m_strFileName = pdlg->GetPathName();
			UpdateData(FALSE);
		}
		delete pdlg;
	}
}

void CInsertDlg::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(TRUE);
	CDialog::OnOK();
}
